package 作业文件.构造方法作业;

public class Person {
    public static void main(String[] args) {
        Person person = new Person("张三",123456);
        Person person1= new  Person("李四",456789);
        System.out.println("身份证号码比较结果为："+person.compareTo(person1));
    }





    //属性
    public String name;
    public int sfzhm;

    //构造方法
    public  Person(String name,int sfzhm){
        this.name=name;
        this.sfzhm=sfzhm;
    }


    //判断两个身份证是否一样
    public  boolean  compareTo(Person person){

        return  this.sfzhm == person.sfzhm;
    }
}
